<?php

namespace App\Http\Requests\WithdrawController;

use Illuminate\Foundation\Http\FormRequest;

class WithdrawRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        $rules = [
            'address' => ['required', 'wallet_address:1'],
            'number' => ['required', 'numeric', 'min:50'],
            'pay_password' => ['required', 'payPassword'],
        ];

        return $rules;
    }

    /**
     * @return array
     */
    public function messages()
    {
        return [
            'coin_id.required' => __('币种ID必填'),
            'coin_id.exists' => __('币种ID不存在'),
            'address.required' => __('钱包地址不能为空'),
            'number.required' => __('提现数量不能为空'),
            'number.min' => __('提现数量最小10'),
            'pay_password.required' => __('交易密码不能为空'),
        ];
    }
}
